/* 重置浏览器默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置全局高度和字体 */
html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 主容器样式 */
.client-container {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f2f5;
}

/* 主聊天区域 */
.main {
    width: 1000px;
    height: 740px;
    background-color: rgb(238, 238, 238);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    z-index: 2;
    overflow: hidden;
}

/* 左侧边栏 */
.main .left {
    width: 280px;
    height: 100%;
    background-color: rgb(46, 50, 56);
    display: flex;
    flex-direction: column;
}

/* 用户信息区域 */
.main .left .user {
    height: 80px;
    font-size: 20px;
    line-height: 80px;
    color: white;
    padding: 0 20px;
    background-color: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 搜索区域 */
.main .left .search {
    height: 60px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.05);
}

.main .left .search input {
    height: 34px;
    flex: 1;
    line-height: 34px;
    font-size: 14px;
    color: white;
    background-color: rgb(38, 41, 46);
    border: none;
    outline: none;
    padding: 0 15px;
    border-radius: 17px;
    transition: background-color 0.3s;
}

.main .left .search input:focus {
    background-color: rgb(50, 54, 60);
}

.main .left .search button {
    height: 34px;
    width: 34px;
    margin-left: 10px;
    border: none;
    outline: none;
    background-color: rgb(38, 41, 46);
    border-radius: 50%;
    background-image: url(../img/search.png);
    background-repeat: no-repeat;
    background-size: 16px;
    background-position: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.main .left .search button:hover {
    background-color: rgb(60, 64, 70);
}

.main .left .search button:active {
    background-color: rgb(70, 75, 82);
}

/* 标签页切换 */
.main .left .tab {
    height: 50px;
    display: flex;
    background-color: rgba(0, 0, 0, 0.1);
}

.main .left .tab div {
    height: 100%;
    width: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
    opacity: 0.7;
}

.main .left .tab div:hover {
    opacity: 0.9;
    background-color: rgba(255, 255, 255, 0.05);
}

.main .left .tab .tab-session {
    background-image: url(../img/session.png);
    background-repeat: no-repeat;
    background-size: 24px;
    background-position: center;
}

.main .left .tab .tab-friend {
    background-image: url(../img/user.png);
    background-repeat: no-repeat;
    background-size: 24px;
    background-position: center;
}

/* 列表样式 */
.main .left .list {
    flex: 1;
    overflow: auto;
}

.main .left .list li {
    height: 60px;
    padding: 10px 20px;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.main .left .list li:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.main .left .list .selected {
    background-color: rgb(46, 54, 65);
}

/* 会话列表特定样式 */
.main .left .list li h3,
.main .left .list li p {
    height: 20px;
    font-size: 14px;
    line-height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main .left .list li p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

/* 好友列表特定样式 */
.main .left .list li h4 {
    height: 40px;
    line-height: 40px;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 隐藏类 */
.hide {
    display: none !important;
}

/* 隐藏滚动条但保留功能 */
.main .left .list::-webkit-scrollbar {
    width: 5px;
}

.main .left .list::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* 右侧聊天区域 */
.main .right {
    width: 720px;
    height: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

/* 聊天标题 */
.main .right .title {
    height: 60px;
    line-height: 60px;
    font-size: 18px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 0 20px;
    font-weight: 500;
}

/* 消息显示区域 */
.main .right .message-show {
    flex: 1;
    padding: 15px;
    overflow: auto;
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
}

.main .right .message-show .message {
    margin-bottom: 15px;
    display: flex;
}

.main .right .message-show .message-left {
    justify-content: flex-start;
}

.main .right .message-show .message-right {
    justify-content: flex-end;
}

.main .right .message-show .message .box {
    max-width: 70%;
}

.main .right .message-show .message .box h4 {
    font-weight: 500;
    height: 20px;
    line-height: 20px;
    font-size: 14px;
    margin-bottom: 5px;
    padding: 0 10px;
    color: #666;
}

.main .right .message-show .message .box p {
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    word-break: break-word;
}

/* 左侧消息样式 */
.main .right .message-show .message-left .box p {
    background-color: white;
    color: #333;
    border-top-left-radius: 5px;
}

/* 右侧消息样式 */
.main .right .message-show .message-right .box p {
    background-color: rgb(123, 181, 107);
    color: white;
    border-top-right-radius: 5px;
}

/* 消息输入区域 */
.main .right .message-input-container {
    padding: 15px;
    background-color: white;
    border-top: 1px solid #e0e0e0;
}

.main .right .message-input {
    display: block;
    width: 100%;
    height: 80px;
    border: 1px solid #e0e0e0;
    outline: none;
    background-color: white;
    padding: 12px;
    resize: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s;
}

.main .right .message-input:focus {
    border-color: rgb(123, 181, 107);
}

/* 控制按钮区域 */
.main .right .ctrl {
    height: 50px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 15px;
    background-color: white;
}

.main .right .ctrl button {
    height: 36px;
    width: 100px;
    background-color: rgb(123, 181, 107);
    border: none;
    border-radius: 18px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.main .right .ctrl button:hover {
    background-color: rgb(105, 160, 90);
}

.main .right .ctrl button:active {
    background-color: rgb(95, 145, 80);
}

/* 消息区域滚动条样式 */
.main .right .message-show::-webkit-scrollbar {
    width: 6px;
}

.main .right .message-show::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}